import time

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("https://baidu.com/")
# 同级兄弟定位
driver.find_element(By.XPATH,
                    "//a[@class='mnav c-font-normal c-color-t' and text()='贴吧']/following-sibling::a[1]").click()
driver.quit()
